#!/bin/bash

# 检查参数个数
if [ "$#" -ne 1 ]; then
    echo "error:incorret input"
    exit 1
fi

# 遍历文件列表，并比较文件的区分度
for file1 in *; do
    for file2 in *; do
        if [ "$file1" != "$file2" ]; then
            difference=$(diff -u "$file1" "$file2" | grep "^[-+]" | wc -l)
            total_lines_file1=$(wc -l < "$file1")
            total_lines_file2=$(wc -l < "$file2")
            if [ "$((difference - 2))" -lt "$1" ]; then
                echo "$file1 $file2 $((difference - 2)) $total_lines_file1 $total_lines_file2"
            fi
        fi
    done
done

